package com.fearless.test20210502.bq;

/*

    阻塞队列测试

 */

import java.util.Queue;
import java.util.concurrent.ArrayBlockingQueue;

public class BlockingQueueTest {




    public static void main(String[] args) {
        test01();
        BlockingQueueTest blockingQueueTest = new BlockingQueueTest();


    }






    public static void test01(){
        //ArrayBlockingQueue会抛出异常
        int c;
        Queue arrayBlockingQueue = new ArrayBlockingQueue<>(3);
        System.out.println(arrayBlockingQueue.add(1));
        System.out.println(arrayBlockingQueue.add(1));
        System.out.println(arrayBlockingQueue.add(1));
        System.out.println();

    }

}
